package com.jeeplus.test.jlnu.student.controller;

import com.jeeplus.test.jlnu.student.domain.entity.BkbsssStudentObtain;
import com.jeeplus.test.jlnu.student.dto.command.UpdateStudentObtainBatchCommand;
import com.jeeplus.test.jlnu.student.service.BkbsssStudentObtainService;
import com.jeeplus.test.tools.resp.R;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author sgy
 * @description
 * @date 2025/7/24
 */
@RestController
@Slf4j
@RequestMapping("/student/obtain")
@RequiredArgsConstructor
public class StudentObtainController {
    private final BkbsssStudentObtainService bkbsssStudentObtainService;
    @PostMapping("/add")
    public R add(@RequestBody BkbsssStudentObtain studentObtain){
        bkbsssStudentObtainService.save(studentObtain);
        return R.suc();
    }

    @PostMapping("/remove/batch")
    public R removeBatch(@RequestBody List<Integer> ids){
        bkbsssStudentObtainService.removeByIds(ids);
        return R.suc();
    }
    @PostMapping("/update/batch")
    public R updateBatch(@RequestBody UpdateStudentObtainBatchCommand updateStudentObtainBatchCommand){
        bkbsssStudentObtainService.updateBatch(updateStudentObtainBatchCommand);
        return R.suc();
    }

}
